/*
 * @Author: xyq
 * @Date: 2021-03-02 11:43:34
 * @LastEditors: xyq
 * @LastEditTime: 2021-03-04 17:09:06
 * @FilePath: \little-eight\src\setupProxy.js
 */
const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function (app) {
  app.use(
    '/api',
    createProxyMiddleware({
      target: 'http://192.168.110.138:8081/admin', //后台服务器地址
      changeOrigin: true,
      pathRewrite: {
        '^/api': '',
      },
    })
  );
};
